import Vue from "vue";
import Vuex from "vuex";

//1.安装插件
Vue.use(Vuex);

//2.创建对象
const store = new Vuex.Store({
  state: {
    isLogin: false,
    token: ''
  },
  getters: {},
  mutations: {
    SETLOGIN(state,token){
      state.isLogin = true;
      state.token = token;
    },
    SETLOGOUT(state){
      state.isLogin = false;
      state.token = '';
    }
  },
  actions: {},
  modules: {},
});
//3.导出使用
export default store;
